import App from '../App'

const agreement = r => require.ensure([], () => r(require('../components/agreement/agreement')), 'agreement')
const ForgotPassword = r => require.ensure([], () => r(require('../components/forgotpwd/index')), 'ForgotPassword')
const QuickLogin = r => require.ensure([], () => r(require('../components/quick-login/index')), 'QuickLogin')
const HelpAgreement = r => require.ensure([], () => r(require('../components/help/agreement')), 'HelpAgreement')
const Lucky = r => require.ensure([], () => r(require('../components/lucky/index')), 'Lucky')
const DebitCredit = r => require.ensure([], () => r(require('../components/market/debit-credit/index')), 'DebitCredit')
const DebitCreditDetail = r => require.ensure([], () => r(require('../components/market/debit-credit/detail')), 'DebitCreditDetail')
const MarketProduct = r => require.ensure([], () => r(require('../components/market/product/index')), 'MarketProduct')
const Account = r => require.ensure([], () => r(require('../components/account/index')), 'Account')
const AboutUs = r => require.ensure([], () => r(require('../components/about-us/index')), 'AboutUs')
const DownloadGuide = r => require.ensure([], () => r(require('../components/download-guide/index.vue')), 'DownloadGuide')
const DownloadApp = r => require.ensure([], () => r(require('../components/download-app/index.vue')), 'DownloadApp')

export default [{
  path: '/',
  component: App,
  children: [
    {
      path: '',
      redirect: '/market/debit-credit'
    },
    {
      path: '/download-app',
      component: DownloadApp
    },
    {
      path: '/download-guide',
      component: DownloadGuide
    },
    {
      path: '/agreement',
      component: agreement,
      meta: {auth: false}
    },
    {
      path: '/forgot-pass/:agentId',
      component: ForgotPassword,
      meta: {auth: false},
      props: true
    },
    {
      path: '/quick-login/:agentId',
      component: QuickLogin,
      meta: {auth: false},
      props: true
    },
    {
      path: '/help/agreement',
      component: HelpAgreement,
      meta: {auth: false}
    },
    {
      path: '/lucky',
      component: Lucky,
      meta: {auth: false}
    },
    {
      path: '/market/debit-credit',
      component: DebitCredit,
      meta: {auth: false}
    },
    {
      path: '/market/debit-credit/detail/:productId/:pageId',
      component: DebitCreditDetail,
      meta: {auth: false},
      props: true
    },
    {
      path: '/market/products/:pageId/:currentTab',
      component: MarketProduct,
      meta: {auth: false},
      props: true
    },
    {
      path: '/account',
      component: Account,
      meta: {auth: false}
    },
    {
      path: '/about-us',
      component: AboutUs,
      meta: {auth: false}
    }
  ]
}]
